home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / fpu881 / src6.zoo / _cmpdf2.s < prev    next >
Text File  |  1991-09-24  |  759b  |  49 lines

  1. | double floating point compare routine
  2. |
  3. | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
  4. | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  5. |
  6. |
  7. | Revision 1.1, kub 12-89 :
  8. | Ported over to 68k assembler
  9. |
  10. | Revision 1.0:
  11. | original 8088 code from P.S.Housel
  12.  
  13.     .text
  14.     .even
  15.     .globl    __cmpdf2, ___cmpdf2
  16.  
  17. __cmpdf2:
  18. ___cmpdf2:
  19.     moveml    sp@(4),d0-d1/a0-a1 | get u and v
  20.     tstl    d0        | check sign bit
  21.     bpl    one
  22.     negl    d1        | negate
  23.     negxl    d0
  24.     eorl    #0x80000000,d0    | toggle sign bit
  25. one:
  26.     exg    a0,d0
  27.     exg    a1,d1
  28.     tstl    d0        | check sign bit
  29.     bpl    two
  30.     negl    d1        | negate
  31.     negxl    d0
  32.     eorl    #0x80000000,d0    | toggle sign bit
  33. two:
  34.     cmpl    d0,a0
  35.     blt    lt
  36.     bgt    gt
  37.     cmpl    d1,a1
  38.     bhi    gt
  39.     beq    eq
  40. lt:
  41.     moveq    #-1,d0
  42.     rts
  43. eq:
  44.     clrl    d0
  45.     rts
  46. gt:
  47.     moveq    #1,d0
  48.     rts
  49.